# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Clint Valentine <valentine.clint@gmail.com>

_pkgname=shellingham
pkgname=python-shellingham
pkgver=1.5.0.post1
pkgrel=4
pkgdesc='Detect what shell the current Python executable is running in'
arch=(any)
url="https://github.com/sarugaku/${_pkgname}"
license=(ISC)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
checkdepends=(python-pytest{,-mock})
_archive="$_pkgname-$pkgver"
source=("$url/archive/$pkgver/$_archive.tar.gz")
sha256sums=('ecc836335bc77e608cd6dc7201e4adfda915f44755593d1001b869ae8caf7be6')

build(){
	cd "$_archive"
	python -m build -wn
}

check() {
	cd "$_archive"
	PYTHONPATH="$PWD/src" pytest
}

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
